#pragma once

#include <string>
#include <cstdio>

class Serializable {
	protected:
		int _data;
	public:
		virtual std::string serialize() = 0; 
};

class A: public Serializable {
	public:
		A(int value){ _data = value;}
		std::string serialize() { 
			char buf[32];
			sprintf(buf, "A:%d", _data);
			return std::string(buf);
		}
		
};

class B: public Serializable {
	public:
		B(int value){ _data = value;}
		std::string serialize() { 
			char buf[32];
			sprintf(buf, "B:%d", _data);
			return std::string(buf);
		}
};

class C: public Serializable {
	public:
		C(int value){ _data = value;}
		void execute() { 
			printf("This is class C: %d\n", _data);
		}
		std::string serialize() { 
			char buf[32];
			sprintf(buf, "C:%d", _data);
			return std::string(buf);
		}
};
